# -*- coding: utf-8 -*-
# @Author: QX
# @File: kyb_login_object.py
import allure
from selenium.webdriver.support.wait import WebDriverWait

#定位元素
@allure.title('定位元素')
@allure.step('定位元素')
def get_element(driver,place):
    return driver.find_element(*place)

#单击元素
@allure.title('单击元素')
@allure.step('单击元素')
def click_element(driver,place):
    driver.find_element(*place).click()

#输入元素内容
@allure.title('输入元素内容')
@allure.step('输入元素内容')
def input_element(driver,place,atext):
    driver.find_element(*place).send_keys(atext)

#显性等待元素
@allure.title('显性等待元素')
@allure.step('显性等待元素')
def wait_explicit(driver,place):
    ele = WebDriverWait(driver, 7, 0.5).until(lambda x: x.find_element(*place))
    return ele
@allure.step('直接输入文本')
def inputtext(driver,place,texts):
    ele = wait_explicit(driver, place)
    ele.clear()
    ele.send_keys(texts)

